<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class RenterRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'province_code'     => 'required|string',
            //'province_name'     => 'required|string',
            'city_code'         => 'required|string',
            'city_name'         => 'required|string',
            'region_code'       => 'required|string',
            'region_name'       => 'required|string',
            'name'              => 'required|string',
            'linkman'           => 'required|string',
            'telephone'         => 'required|string',
            'starttime'         => 'required|date|string',
            'endtime'           => 'required|date|string',
            'rente_type'        => 'required|integer',
            'rente_price'        => '',
            'property_type'     => 'required|integer',
            'property_price'     => '',
            'water_electricity_type'=> 'required|integer',
            'operation_type'    => 'required|integer',
            'operation_price_A1'    => '',
            'operation_price_A2'    => '',
            'operation_price_B1'    => '',
            'operation_price_B2'    => '',
            'contracturl'       => 'required|string',
        ];
    }

    /**
     * @return string[]
     */
    public function messages()
    {
        return [
            'province_code.required'    => '省代码不能为空',
            //'province_name.required'    => '省名称不能为空',
            'city_code.required'        => '市代码不能为空',
            'city_name.required'        => '市名称不能为空',
            'region_code.required'      => '区/县代码不能为空',
            'region_name.required'      => '区/县名称不能为空',
            'name.required'             => '场租方名称不能为空',
            'linkman.required'          => '联系人不能为空',
            'telephone.required'        => '联系电话不能为空',
            'starttime.required'        => '合作开始时间不能为空',
            'endtime.required'          => '合作结束时间不能为空',
            'rente_type.required'       => '场地费不能为空',
            'property_type.required'    => '物业费不能为空',
            'water_electricity_type.required'=> '水电费不能为空',
            'operation_type.required'   => '分润方式不能为空',
            'contracturl.required'      => '合同不能为空',

        ];
    }
}
